import { Proton } from "../../../dist/three.proton";
class PosSpring {
        constructor(spring, friction, life, easing) {
            PosSpring._super_.call(this, life, easing);
            PosSpring.prototype.reset(spring, friction);
            this.name = "Spring";
        }
        reset(spring, friction) {
            this.spring = spring || .1;
            this.friction = friction || .98;
        }
        initialize(particle) {
            particle.transform.pos = particle.p.clone();
        }
        applyBehaviour(particle, time, index) {
            super.applyBehaviour(particle, time, index);
            particle.v.x += (particle.transform.pos.x - particle.p.x) * this.spring;
            particle.v.y += (particle.transform.pos.y - particle.p.y) * this.spring;
            particle.v.z += (particle.transform.pos.z - particle.p.z) * this.spring;
        }
    }



    
    Proton.PosSpring = PosSpring;
